import { useLocation } from "umi";
import { Space, Descriptions } from "antd";

const BaseInformation = () => {
    const location = useLocation();

    const staff = location.state?.staff || {};

    return (
        <Space direction="vertical" style={{ padding: 10, width: "100%" }} size={10}>
            <Descriptions column={1} bordered labelStyle={{ width: 140 }}>
                <Descriptions.Item label="姓名">{staff.osName}</Descriptions.Item>
                <Descriptions.Item label="当前职位">{staff.position?.opName || "-"}</Descriptions.Item>
                <Descriptions.Item label="直属上级">{staff.deInfo?.osName || "-"}</Descriptions.Item>
                <Descriptions.Item label="身份证号">{staff.osIdnu || "-"}</Descriptions.Item>
                <Descriptions.Item label="手机号">{staff.osPhon || "-"}</Descriptions.Item>
                <Descriptions.Item label="性别">{staff.osRoge || "-"}</Descriptions.Item>
                <Descriptions.Item label="生日">{staff.osBirt || "-"}</Descriptions.Item>
                <Descriptions.Item label="紧急联系人">
                    <Space size={100}>
                        <div>姓名：{staff.ecInfo?.name || "-"}</div>
                        <div>手机号：{staff.ecInfo?.phone || "-"}</div>
                    </Space>
                </Descriptions.Item>
                <Descriptions.Item label="现居住地址">
                    <Space size={100}>
                        <div>
                            {staff.osPrin} {staff.osCity} {staff.osDist}
                        </div>
                        <div>{staff.osAddr}</div>
                    </Space>
                </Descriptions.Item>
            </Descriptions>
        </Space>
    );
};

export default BaseInformation;
